<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>图书列表</title>
</head>
<body>
  <h2>图书列表</h2>
  <button onclick="window.location='/book/toAdd'">添加</button>
  <ul>
    <%
      books.forEach(b => {
    %>
      <li>
        <%=b._id%>--<%=b.name%>--<%=b.author%>--<%=b.price%>
        <button onclick="window.location='/book/toUpdate/<%=b._id%>'">修改</button>
        <button onclick="window.location='/book/remove/<%=b._id%>'">删除</button>
      </li>
    <%
      })
    %>
  </ul>
</body>
</html>